#!/usr/bin/env python
# -*- coding: latin-1 -*-

import sys, os

sys.path.insert(0, os.path.join(os.path.abspath(os.path.dirname(sys.argv[0])),".."))
import Process

if Process.verifyCommands("id3")==False:
	sys.exit()

files = os.environ['NAUTILUS_SCRIPT_SELECTED_FILE_PATHS'].split("\n")

f = files[0]

if len(files)>2:
	Process.alert("Sólo debe seleccionar un archivo")
else:
	if Process.getExtension(f) == "MP3" or Process.getExtension(f) == "OGG":
		data = os.popen("id3 -l \""+f+"\"").readlines()
		Process.alert( data[1] + "\n" + data[2] + "\n" + data[3])
	else:
		Process.alert("Debe seleccionar un archivo OGG o MP3")

